<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href='/css/styles.css' rel='stylesheet' type='text/css' />
    <link href='/images/favicon.png' rel='shortcut icon' />
    <script src='/js/jquery.min.1.4.js'></script>
    <script src='/js/app.js'></script>
    <script src='/js/common.js'></script>
    
    <meta content='width=device-width, minimum-scale=1.0, maximum-scale=1.0' name='viewport' />
    <title>redis - 命令</title>
	<meta http-equiv="description" content="redis中文资料站，下载安装redis，查找redis常用命令（commands），选择适合的redis客户端方式，配置redis主从（master-slave），阅读redis官方文档，社区里了解更多redis信息，提交redis的bug。" />
	
  </head>
  <body class=''>
    <script src='/js/head.js'></script>
    <div class='text'>
      <h1 class='command'>
        <span id='command_name_span' class='name'></span>
        <span id='command_args_span' class='arg'></span>
      </h1>
      <article>
      	<aside>
        	<script type='text/javascript'>showCmdURL();</script>
        </aside>
        
        <div class='metadata'>
          <p><strong>加入版本 <span id='command_ver_span'></span>。</strong></p>
           
        </div>
        
        <p><code>CONFIG GET</code>命令用来读取redis服务器的配置文件参数，但并不是所有参数都支持。         
        与之对应的命令是<code>CONFIG SET</code>用来设置服务器的配置参数。</p>
        
        <p><code>CONFIG GET</code> 命令只接受一个参数，所有配置参数都采用key-value的形式。 例如:</p>
        
        <pre><code>redis&gt; config get *max-*-entries*&#x000A;1) "hash-max-zipmap-entries"&#x000A;2) "512"&#x000A;3) "list-max-ziplist-entries"&#x000A;4) "512"&#x000A;5) "set-max-intset-entries"&#x000A;6) "512"&#x000A;</code></pre>
        
        <p>通过
        <code>CONFIG GET *</code> 可以查看所有支持的参数。</p>
        
        <p>所有支持的参数都与<a href="http://github.com/antirez/redis/raw/2.2/redis.conf">redis.conf</a> 里面的一样，除了如下的重要差异：</p>
        
        <ul>
        <li>Where bytes or other quantities are specified, it is not possible to use the redis.conf abbreviated form (10k 2gb ... and so forth), everything should be specified as a well formed 64 bit integer, in the base unit of the configuration directive.</li>
        <li>The save parameter is a single string of space separated integers. Every pair of integers represent a seconds/modifications threshold.</li>
        </ul>
        
        
        <p>举例说明，像redis.conf里面的如下配置:</p>
        
        <pre><code>save 900 1&#x000A;save 300 10&#x000A;</code></pre>
        
        <p>它的意思是：如果900秒内有一个数据发生变化，或者300秒内有10个数据发生变化，那么使用 <code>CONFIG GET</code> 查看时将会看到 "900 1 300 10"。</p>
		
        <h2>返回值</h2>
        
      
        <p>该命令返回的类型是<a href="/topics/protocol.html#bulk-reply">Bulk reply</a>.</p>
        
      </article>
    </div>
    <script type='text/javascript'>startShow();</script>
    <div class='text' id='comments'>
      <div id='disqus_thread'></div>
      <script type='text/javascript'>
        //<![CDATA[
          var disqus_shortname = 'rediscn';
          
          // The following are highly recommended additional parameters. Remove the slashes in front to use.
          var disqus_identifier = 'command_'+curCommandObj.key;
          var disqus_url = curCommandObj.getdisqusUrl();  // = 'http://redis.cn/commands/'+curCommandObj.key;
          
          /* * * DON'T EDIT BELOW THIS LINE * * */
          (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
              dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
              (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
          })();
        //]]>
      </script>
      <a class='dsq-brlink' href='http://disqus.com'>
        Comments powered by
        <span class='logo-disqus'>
          Disqus
        </span>
      </a>
    </div>

    
    <script src='/js/foot.js'></script>
    
  </body>
</html>
